<template>
    <div>
        <TableHeader :buttons="['refresh', 'comSearch', 'quickSearch', 'columnDisplay']" :quick-search-placeholder="'通过标题模糊搜索'" />
        <Table />
    </div>
</template>

<script setup lang="ts">
import { provide } from 'vue'
import aaTableClass from '/@/utils/aaTable'
import Table from '/@/components/table/index.vue'
import TableHeader from '/@/components/table/header/index.vue'

defineOptions({
    name: 'auth/adminLog',
})

const data = [
    {
        id: 43,
        admin_id: 1,
        username: 'admin',
        url: '/admin/auth.Rule/edit',
        title: '菜单规则管理-编辑',
        data: '{"id":"7","status":"0"}',
        ip: '127.0.0.1',
        useragent: 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/128.0.0.0 Safari/537.36',
        create_time: 1741081043,
    },
    {
        id: 42,
        admin_id: 1,
        username: 'admin',
        url: '/admin/auth.Rule/sortable',
        title: '菜单规则管理-快速排序',
        data: '{"move":"7","target":"4","direction":"down"}',
        ip: '127.0.0.1',
        useragent: 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/128.0.0.0 Safari/537.36',
        create_time: 1741080976,
    },
    {
        id: 41,
        admin_id: 1,
        username: 'admin',
        url: '/admin/auth.Rule/edit',
        title: '菜单规则管理-编辑',
        data: '{"id":"7","keepalive":"0"}',
        ip: '127.0.0.1',
        useragent: 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/128.0.0.0 Safari/537.36',
        create_time: 1741080966,
    },
    {
        id: 40,
        admin_id: 1,
        username: 'admin',
        url: '/admin/auth.Rule/edit',
        title: '菜单规则管理-编辑',
        data: '{"id":"7","keepalive":"1"}',
        ip: '127.0.0.1',
        useragent: 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/128.0.0.0 Safari/537.36',
        create_time: 1741080965,
    },
    {
        id: 39,
        admin_id: 1,
        username: 'admin',
        url: '/admin/Index/login',
        title: '登录',
        data: '{"username":"admin","password":"***","keep":"","captchaId":"326a9553-e3f8-4d08-8704-3f841140f44d","captchaInfo":"226,148-120,58;350;200"}',
        ip: '127.0.0.1',
        useragent: 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/128.0.0.0 Safari/537.36',
        create_time: 1740971668,
    },
    {
        id: 38,
        admin_id: 1,
        username: 'admin',
        url: '/admin/Index/login',
        title: '登录',
        data: '{"username":"admin","password":"***","keep":"","captchaId":"e36d5585-a798-4256-9e91-a2873c21a381","captchaInfo":"264,174-176,95;350;200"}',
        ip: '127.0.0.1',
        useragent: 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/128.0.0.0 Safari/537.36',
        create_time: 1740622294,
    },
    {
        id: 37,
        admin_id: 1,
        username: 'admin',
        url: '/admin/user.Rule/edit',
        title: '会员规则管理-编辑',
        data: '{"id":"1","status":"1"}',
        ip: '127.0.0.1',
        useragent: 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/128.0.0.0 Safari/537.36',
        create_time: 1740361671,
    },
    {
        id: 36,
        admin_id: 1,
        username: 'admin',
        url: '/admin/user.Rule/edit',
        title: '会员规则管理-编辑',
        data: '{"id":"1","status":"0"}',
        ip: '127.0.0.1',
        useragent: 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/128.0.0.0 Safari/537.36',
        create_time: 1740361670,
    },
    {
        id: 35,
        admin_id: 1,
        username: 'admin',
        url: '/admin/user.Rule/edit',
        title: '会员规则管理-编辑',
        data: '{"id":"6","pid":"1","type":"menu","title":"\\u4f59\\u989d\\u8bb0\\u5f55","name":"account\\/balance","path":"account\\/balance","icon":"fa fa-money","menu_type":"tab","url":"","component":"\\/src\\/views\\/frontend\\/user\\/account\\/balance.vue","no_login_valid":"0","extend":"none","remark":"","weigh":"95","status":"1","update_time":"1738917624","create_time":"1738917624"}',
        ip: '127.0.0.1',
        useragent: 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/128.0.0.0 Safari/537.36',
        create_time: 1740361637,
    },
    {
        id: 34,
        admin_id: 1,
        username: 'admin',
        url: '/admin/user.Rule/edit',
        title: '会员规则管理-编辑',
        data: '{"id":"5","pid":"1","type":"menu","title":"\\u79ef\\u5206\\u8bb0\\u5f55","name":"account\\/integral","path":"account\\/integral","icon":"fa fa-tag","menu_type":"tab","url":"","component":"\\/src\\/views\\/frontend\\/user\\/account\\/integral.vue","no_login_valid":"0","extend":"none","remark":"","weigh":"96","status":"1","update_time":"1738917624","create_time":"1738917624"}',
        ip: '127.0.0.1',
        useragent: 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/128.0.0.0 Safari/537.36',
        create_time: 1740361632,
    },
]

const aaTable = new aaTableClass({
    column: [
        { type: 'selection', align: 'center', operator: false },
        {
            label: '用户名',
            prop: 'username',
            align: 'center',
            operator: 'LIKE',
            operatorPlaceholder: '模糊查询',
            width: 160,
        },
        { label: '标题', prop: 'title', align: 'center', operator: 'LIKE', operatorPlaceholder: '模糊查询' },
        {
            show: false,
            label: '请求数据',
            prop: 'data',
            align: 'center',
            operator: 'LIKE',
            operatorPlaceholder: '模糊查询',
            showOverflowTooltip: true,
        },
        {
            label: 'url',
            prop: 'url',
            align: 'center',
            operator: 'LIKE',
            operatorPlaceholder: '模糊查询',
            showOverflowTooltip: true,
            render: 'url',
        },
        { label: '登录ip', prop: 'ip', align: 'center', operator: 'LIKE', operatorPlaceholder: '模糊查询', render: 'tag' },
        {
            label: 'useragent',
            prop: 'useragent',
            align: 'center',
            operator: 'LIKE',
            operatorPlaceholder: '模糊查询',
            showOverflowTooltip: true,
        },
        {
            label: '创建时间',
            prop: 'create_time',
            align: 'center',
            render: 'datetime',
            sortable: 'custom',
            operator: 'RANGE',
            width: 160,
        },
        {
            label: '操作',
            align: 'center',
            width: '100',
            render: 'buttons',
            buttons: [
                {
                    render: 'tipButton',
                    name: 'info',
                    title: '查看详情',
                    text: '',
                    type: 'primary',
                    icon: 'fa fa-search-plus',
                    class: 'table-row-edit',
                },
            ],
            operator: false,
        },
    ],
    data,
    dblClickNotEditColumn: [undefined],
})

provide('aaTable', aaTable)
</script>
